Ext.define('Era.view.ManageScreen',{
   extend: 'Ext.grid.Panel',
   alias: 'widget.managescreen',
   store: null,
   
   border: false,
   frame: true,
   resizable: false,
   columns: [
        {
            header: 'Title',
            dataIndex: 'title',
            flex: 1,
            resizable: false,
            menuDisabled: true
        },
        {
            header: 'Start',
            dataIndex: 'start_date',
            flex: 1,
            resizable: false,
            menuDisabled: true,
            renderer: Ext.util.Format.dateRenderer('d-m-Y')
        },
        {
            xtype:'actioncolumn',  
            width:30,
            resizable: false,
            menuDisabled: true,
            items: [{
                icon: 'data/images/add.gif',
                tooltip: 'Manage',
                stopSelection: true,

                handler: function(grid, rowIndex, colIndex) {                       
                    
                }
            }]
        }   
    ],
    
    viewConfig:{
        deferEmptyText: false,
        emptyText:'No events found.'
        
    },
    listeners: {
        itemmouseenter: function(view, record){
            Era.controller.Main.showPreviewWindow(Era.controller.Main.menuWindow,record);
        },
        itemmouseleave: function(){
            Era.controller.Main.hidePreviewWindow();
        },
        itemclick: function(view,record){
            
            var screen = Ext.create('Era.view.FinishScreen',{
                record: record
            });

            // hide any previews
            Era.controller.Main.hidePreviewWindow();
            
            // load form in the menu panel
            Era.controller.Main.showMenuScreen(screen);
        }
    }
});


